# coding=utf-8

#获取单个地址的行政区域
import requests
import json
# address = '上海闸北区广中西路777弄91、99号504室506室'
address = '150201'
# todo:地理编码
# url = 'https://restapi.amap.com/v3/geocode/geo?city='+address+'&output=JOSON&key=ff7b0eb4bcb04528474c085e8a2f63e4'
# todo：行政区域查询
url = 'https://restapi.amap.com/v3/config/district?adcode='+address+'&output=JOSON&key=ff7b0eb4bcb04528474c085e8a2f63e4'
request=requests.get(url).text
result = json.loads(request)
print(result)